<table layoutH="170" class="table" width="100%">
    <thead>
    <tr>
        <th width="5%">ID</th>
        <th width="15%">流水线名</th>
        <th width="25%">流水线标题</th>
        <th width="10%">状态</th>
        <th width="25%">流水线最大长度</th>
        <th width="20%">操作</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach ($pipe_list as $pipe) { ?>
        <tr>
            <td><?php echo $pipe['pipe_id'] ?></td>
            <td><?php echo $pipe['pipe_name'] ?></td>
            <td><?php echo $pipe['pipe_title'] ?></td>
            <td><?php echo ($pipe['pipe_status'] == 1) ? '正常' : '暂停' ?></td>
            <td><?php echo $pipe['pipe_max'] ?></td>
            <td>
                <a href="javascript:change_status(<?php echo $pipe['pipe_id'] . ',' . $pipe['pipe_status']; ?>);"><?php echo ($pipe['pipe_status'] == 1) ? '暂停' : '正常' ?></a>
                |
                <a href="<?php echo site_url('c=pipeline&m=edit_pipe&');?>pipe_id=<?php echo $pipe['pipe_id'] ?>" target="dialog" mask="true"
                   title="修改">修改</a>
            </td>
        </tr>
    <?php } ?>
    </tbody>
</table>
<script type="text/javascript">
    function change_status(pipe_id, pipe_status) {
        if (pipe_status == 1) {
            pipe_status = 0;
        } else {
            pipe_status = 1;
        }

        $.post('<?php echo site_url('c=pipeline&m=change_status&');?>' + parseInt(10 * Math.random()),
            {'pipe_id': pipe_id, 'pipe_status': pipe_status}, function (data) {
                navTab.reload("<?php echo site_url('c=pipeline&m=manage&');?>" + parseInt(10 * Math.random()), "", "pipeline_manage");
            });
    }
</script>
